package com.example.teesystem.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import org.jetbrains.annotations.NotNull;

import java.io.Serializable;
import java.util.Date;

/**
 * 
 * @TableName t_issue_record
 */
@TableName(value ="t_issue_record")
@Data
public class IssueRecord implements Serializable, Comparable<IssueRecord> {
    /**
     * key自增
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 题目id
     */
    @TableField(value = "issue_id")
    private Integer issueId;

    /**
     * 学生的答案（最后一次作答答案）
     */
    @TableField(value = "answer")
    private String answer;

    /**
     * 最后一次作答是否正确（0：错误，1：正确）
     */
    @TableField(value = "is_right")
    private Integer isRight;

    /**
     * 学生id
     */
    @TableField(value = "student_id")
    private Integer studentId;

    /**
     * 答对次数
     */
    @TableField(value = "right_num")
    private Integer rightNum;

    /**
     * 答错次数
     */
    @TableField(value = "wrong_num")
    private Integer wrongNum;

    /**
     * 加入日期
     */
    @TableField(value = "upload_time",fill = FieldFill.INSERT)
    private Date uploadTime;

    @TableField(value = "course_id")
    private Integer courseId;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public int compareTo(@NotNull IssueRecord o) {
        return this.getIssueId() - o.getIssueId();
    }
}